fix: Actually close the connections properly #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Properly closes the doctor connections.
active_side
is the side that last receives data. Thus it needs to indicate it's happy viaconn.close(...)
. For good measure, we alsoconn.closed().await
.passive_side
is the side that last sends data and doesaccept_bi
. We race this loop with theconn.closed()
because that indicates the other side is done. As this is not an error, we just exit.passive_side
errors, we send aconn.close()
earlier. This would be optional, if theEndpoint
were shutdown gracefully... Which never happens. But that's another PR.Change checklist
[ ] Tests if relevant.